<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        #box{
            width: 200px;
            height: 200px;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <h1>JS 改变元素的样式属性</h1>
    <button onclick="makeLong()">变长</button>
    <hr>

    <div id="box"></div>

    <script>

        function makeLong() {
            var box = document.getElementById('box');
            box.style.backgroundColor = '#f90';
            box.style.width = '50px';
            box.style.height = '3000px';
        }
    

   

    </script>
</body>
</html>